﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RXY_Mall.Services.Goods.Dto
{
    /// <summary>
    /// 批量添加分类输入信息
    /// </summary>
    public class AddCategoriesInput : MangerBaseInput
    {
        /// <summary>
        /// 分类录入信息
        /// </summary>
        public List<CategoryInput> categories { get; set; }
    }

    /// <summary>
    /// 分类信息
    /// </summary>
    public class CategoryInput
    {
        /// <summary>
        /// 公司编号
        /// </summary>
        public string api_company_id { get; set; }
        /// <summary>
        /// 分类编号
        /// </summary>
        [Required(ErrorMessage = "分类编号不能为空")]
        public string api_category_id { get; set; }
        /// <summary>
        /// 分类父编号
        /// </summary>
        public string api_parent_id { get; set; }
        /// <summary>
        /// 分类名称
        /// </summary>
        [Required(ErrorMessage = "分类编号不能为空")]
        public string category_name { get; set; }

    }

    /// <summary>
    /// 批量添加品牌输入信息
    /// </summary>
    public class AddBrandsInput : MangerBaseInput
    {
        /// <summary>
        /// 品牌录入信息
        /// </summary>
        public List<BrandInput> brands { get; set; }
    }

    /// <summary>
    /// 品牌信息
    /// </summary>
    public class BrandInput
    {
        /// <summary>
        /// 公司编号
        /// </summary>
        public string api_company_id { get; set; }
        /// <summary>
        /// 品牌编号
        /// </summary>
        [Required(ErrorMessage = "品牌编号不能为空")]
        public string api_brand_id { get; set; }
        /// <summary>
        /// 品牌名称
        /// </summary>
        [Required(ErrorMessage = "品牌编号不能为空")]
        public string brand_name { get; set; }
    }

    /// <summary>
    /// 批量添加商品输入信息
    /// </summary>
    public class AddGoodsInput : MangerBaseInput
    {
        /// <summary>
        /// 商品录入信息
        /// </summary>
        public List<GoodsInput> goods { get; set; }
    }

    /// <summary>
    /// 商品信息
    /// </summary>
    public class GoodsInput
    {
        /// <summary>
        /// 店铺编号
        /// </summary>
        [Required(ErrorMessage = "店铺编号不能为空")]
        public string api_shop_id { get; set; }
        /// <summary>
        /// ERP商品分类名
        /// </summary>
        public string api_category_name { get; set; }
        /// <summary>
        /// ERP品牌
        /// </summary>
        public string api_brand_name { get; set; }
        ///// <summary>
        ///// 分类编号
        ///// </summary>
        //[Required(ErrorMessage = "分类编号不能为空")]
        //public string api_category_id { get; set; }
        ///// <summary>
        ///// 品牌编号
        ///// </summary>
        //[Required(ErrorMessage = "品牌编号不能为空")]
        //public string api_brand_id { get; set; }
        /// <summary>
        /// 商品编号
        /// </summary>
        [Required(ErrorMessage = "商品编号不能为空")]
        public string api_goods_id { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        [Required(ErrorMessage = "商品名称不能为空")]
        public string goods_name { get; set; }
        /// <summary>
        /// 商品规格
        /// </summary>
        [Required(ErrorMessage = "商品规格不能为空")]
        public string goods_spec { get; set; }
        /// <summary>
        /// 助记符
        /// </summary>
        [Required(ErrorMessage = "助记符不能为空")]
        public string goods_mnemonic { get; set; }
        /// <summary>
        /// Sku
        /// </summary>
        public List<SkuDto> skus { get; set; }

    }

    /// <summary>
    /// 商品SKU输出类
    /// </summary>
    public class SkuDto
    {
        /// <summary>
        /// Sku编号
        /// </summary>
        [Required(ErrorMessage = "sku编号不能为空")]
        public string api_sku_id { get; set; }
        /// <summary>
        /// 销售价
        /// </summary>
        [Required(ErrorMessage = "销售价不能为空")]
        public Nullable<decimal> sale_price { get; set; }
        /// <summary>
        /// 转换比
        /// </summary>
        [Required(ErrorMessage = "转换比不能为空")]
        public int conversion_rate { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        [Required(ErrorMessage = "规格不能为空")]
        public List<SpecDto> specs { get; set; }
        /// <summary>
        /// S-small(小) M-medium(中) L-large(大)
        /// </summary>
        [Required(ErrorMessage = "单位不能为空")]
        public string api_unit { get; set; }
    }

    /// <summary>
    /// 商品规格输出类
    /// </summary>
    public class SpecDto
    {
        /// <summary>
        /// 规格键
        /// </summary>
        public string spec_key { get; set; }
        /// <summary>
        /// 规格值
        /// </summary>
        public string spec_value { get; set; }
    }


}
